home *** CD-ROM | disk | FTP | other *** search
- Path: news.mel.aone.net.au!usenet
- From: awedding@iig.com.au
- Newsgroups: comp.lang.c++
- Subject: A little programme I am having trouble with - ass1.cpp (0/1)
- Date: Wed, 03 Apr 1996 00:02:35 GMT
- Message-ID: <4jsf4q$f9o@news.mel.aone.net.au>
- NNTP-Posting-Host: cnsta03.iig.com.au
- X-Newsreader: Forte Free Agent 1.0.82
-
- Hi everyone,
-
- I am tring to write the programme below but keep getting the
- message "Possibly incorrect assignment in function main()" Could
- someone PLEASE help me. If you could Email your response to
-
- awedding@iig.com.au
-
- I would be more than grateful.
- Thanks in advance
-
-
- /* This programme is used to calculate the cost of a phone call after
- the
- user has entered the time of call and duration of call.
-
- Input : Time that call was made, in minutes and seconds
- : Length of call, in minutes and seconds
- : Distance of call, in Kilometers
-
- Output : The cost of the phone call
-
- Constants : The amount charged at a certain time and distance
-
- ---------------------------------------------------------------------
- */
-
- #include <iostream.h>
- void main ( void )
- {
- int
- TimeScale, DistCalled, DurMin, DurSec, D, N, E, Distance ;
-
- double
- CostPerMin ;
-
- cout << "Enter the time scale used (D/N/E)" ;
- cin >> TimeScale ;
- cout << "Enter the distance called" ;
- cin >> DistCalled ;
- cout << "Enter the duration of the call (Min & Sec" ;
- cin >> DurMin >> DurSec ;
-
- if ((TimeScale = D) && (Distance >745))
- cin >> CostPerMin = 0.55 ;
- else if ((TimeScale = D) && (Distance <745) && (Distance >165))
- cin >> CostPerMin = 0.375 ;
- else if ((TimeScale = D) && (Distance <165) && (Distance >85))
- cin >> CostPerMin = 0.35 ;
- else if ((TimeScale = D) && (Distance <85) && (Distance >25))
- cin >> CostPerMin = 0.15 ;
-
- // The above is if the user called during the DAY time scale
-
-
- if ((TimeScale = N) && (Distance >745))
- cin >> CostPerMin = 0.375 ;
- else if ((TimeScale = N) && (Distance <745) && (Distance >165))
- cin >> CostPerMin = 0.25 ;
- else if ((TimeScale = N) && (Distance <165) && (Distance >85))
- cin >> CostPerMin = 0.25 ;
- else if ((TimeScale = N) && (Distance <85) && (Distance >25))
- cin >> CostPerMin = 0.10 ;
-
- // The above is if the user called during the NIGHT time scale
-
- if ((TimeScale = D) && (Distance >745))
- cin >> CostPerMin = 0.225 ;
- else if ((TimeScale = D) && (Distance <745) && (Distance >165))
- cin >> CostPerMin = 0.15 ;
- else if ((TimeScale = D) && (Distance <165) && (Distance >85))
- cin >> CostPerMin = 0.15 ;
- else if ((TimeScale = D) && (Distance <85) && (Distance >25))
- cin >> CostPerMin = 0.075 ;
-
- // The above is if the user called during the ECONOMY time scale
-
- }
-
-